<div id="user_page">
    <div id="user_wrapper">
        <p class="p_user_heading">Users</p>
        <?php echo form_open('user/delete_update', array('id' => 'users_form')); ?>
          <div id="ud_c">
            <div id="delete_c">
              <label id="update_lbl">Delete Users: </label><br/>
              <input name="deleteB" type="submit" value="Delete Checked" id="delete_user" /></div>
            <div id="update_c">
                <label id="update_lbl">Update Role to: </label><br/>
                  <?php $roles = $this->role_m->get_all_roles();
                      foreach($roles as $row) {
                        echo '<input class="role_choice" name="role" type="radio" value=' . $row->role_id .'><span id=rb_value>' . $row->rolename . '</span>';
                      }
                  ?>
                <input name="roleB" type="submit" value="Update Checked" id="update_role" />
              </div>
          </div>
        
          <br/><br/><br/>
          <div class="wrapper">
            <script type="text/javascript">
            $(document).ready(function() {
                var oTable = $('#big_table').dataTable( {
                  "aoColumnDefs"  : [{
                      aTargets: [0],    // Column number which needs to be modified
                      fnRender: function (o, v) {   // o, v contains the object and value for the column
                          return '<input type="checkbox" name="user[]" value="'+v+'" />';
                      },
                      sClass: 'tableCell'    // Optional - class to be applied to this table cell
                  }],
                  "aoColumns": [
                  { "sWidth": "1%" },
                  { "sWidth": "8%" },
                  { "sWidth": "15%" },
                  { "sWidth": "15%" },
                  { "sWidth": "15%" },
                  
                  { "sWidth": "15%" },
                  { "sWidth": "15%" },
                  { "sWidth": "5%" },
                  { "sWidth": "15%" },
                  { "sWidth": "15%" }
                  ],
                  "bAutoWidth": false,
                  "sScrollXInner": "100%",
                  "bProcessing": true,
                  "bServerSide": true,
                  "sDom": 'T<"clear">lfrtip',
                  "oTableTools": {
                    "aButtons": [
                        {
                            "sExtends": "copy",
                            "mColumns": [1, 2, 3, 4, 5, 6, 7, 8]
                        },
                        {
                            "sExtends": "csv",
                            "mColumns": [1, 2, 3, 4, 5, 6, 7, 8]
                        },
                        {
                            "sExtends": "xls",
                            "mColumns": [1, 2, 3, 4, 5, 6, 7, 8]
                        },
                        {
                            "sExtends": "pdf",
                            "mColumns": [1, 2, 3, 4, 5, 6, 7, 8]
                        }
                    ],
                    "sSwfPath" : "resources/swf/copy_csv_xls_pdf.swf"
                  },
                  "sAjaxSource": '<?php echo base_url(); ?>user_c/datatable',
                              "bJQueryUI": true,
                              "sPaginationType": "full_numbers",
                              "iDisplayStart ":20,
                              "oLanguage": {
                                "sProcessing": "<img src='resources/images/ajax-loader_dark.gif'>"
                              },  
                              "fnInitComplete": function() {
                                      oTable.fnAdjustColumnSizing();
                              },
                              "fnServerData": function(sSource, aoData, fnCallback) {
                                    $.ajax
                                    ({
                                      'dataType': 'json',
                                      'type'    : 'POST',
                                      'url'     : sSource,
                                      'data'    : aoData,
                                      'success' : fnCallback
                                    });
                              }
                } );
                oTable.fnSort( [ [1,'asc'] ] );
            } );
            </script>
            <?php echo $this->table->generate(); ?>
          </div>
        <?php echo form_close(); ?>
    </div>
</div>
